package com.coffee.service.impl;

import com.coffee.conmmon.BaseResult;
import com.coffee.dao.CartDaoMapper;
import com.coffee.entity.Cart;
import com.coffee.entity.Cart1;
import com.coffee.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl implements CartService {
    @Autowired
    private CartDaoMapper cartDaoMapper;

    @Override
    public List<Cart> findAllCart(Integer uid) {
        return cartDaoMapper.findAllCart(uid);
    }

    @Override
    public Cart findByIdCart(Integer coid,Integer uid) {
        return cartDaoMapper.findByIdCart(coid,uid);
    }

    @Override
    public Integer insertCart(Cart cart1) {
        return cartDaoMapper.insertCart(cart1);
    }

    @Override
    public Integer updateCart(Cart cart1) {
        return cartDaoMapper.updateCart(cart1);
    }

    @Override
    public Integer deleteCart(Integer caid,Integer uid) {
        return cartDaoMapper.deleteCart(caid,uid);
    }

    @Override
    public Integer deleteAll(Integer uid) {
        return cartDaoMapper.deleteAll(uid);
    }

    @Override
    public List<Cart1> findAllCart1(Integer uid) {
        return cartDaoMapper.findAllCart1(uid);
    }
}
